home *** CD-ROM | disk | FTP | other *** search
- /* ARexx - Texture.rexx applies a simple texture to the selected area in IMR/t */
-
- /*
- * This is how to do a 'process' operation. Processes are very simple,
- * all you need to do is :
- * (1) The area selection
- * (2) Ask the user for any parameters needed
- * (3) Backup the image to the UNDO buffer
- * (4) Call the function that applies the change
- * (5) Redraw the image
- * (6) Tell Imagemaster R/t the script has finished
- *
- * If you want to do image loaders and savers, see the examples used
- * for the PMBC format. There is considerably more involved
- * ARexx logic involved in deciding what to do with the new buffer,
- * allocating the right size (you have to look at the source image
- * to see what that size is!). Anyway, it's still pretty easy.
- *
- * This .REXX file would normally go into the RXPI: assigned directory
- * and the executable into the CMPI: assigned directory
- * Then you would add a line to CMPI:list.list as follows:
- texture, "Apply a simple texture", effect
-
- *
- * Feel free to use our examples as 'boilerplate' for your own work.
- */
-
- /* Direct the ARexx commands to Imagemaster R/t */
- prtnme = 'IM_Port';
- address(prtnme);
-
- /* First: the area selection */
- 'tofront';
- 'messagelow Set the Area Select mode for an area selection to follow';
- 'area';
-
- /* Second: get the function parameters */
- options results;
- 'askprop "Change (%)" 50 0 100';
- level = result;
- options;
-
- /* Third: back up to the undo buffer */
- 'backuptoundo';
-
- /* Forth: actually call the function */
- options results;
- 'jackin'; /* get the pointer to the Public Interface */
- jacker = result;
- options;
- address command;
- 'cmpi:texture '||jacker||' '||level; /* run the actual operation (See the 'c' code) */
- address(prtnme);
-
- /* Fifth: redraw the image */
- 'tofront';
- 'redraw';
-
- /* Lastly: if this is to be used in a multi-frame sequence, we must tell */
- /* Imagemaster R/t that we are finished */
- 'finish';
-
- exit 0;
-